def findKthLargest(nums, k):
    i = 1
    while i < k:
        nums.remove(DC(nums, 0, len(nums) - 1))
        i += 1
    return DC(nums, 0, len(nums) - 1)


def DC(nums, left, right):
    if left == right:
        return nums[left]
    mid = left + (right - left) // 2
    left_max = DC(nums, left, mid)
    right_max = DC(nums, mid + 1, right)
    return max(left_max, right_max)


nums = [6, 1, 2, 3, 5, 4]
print(findKthLargest(nums, 2))  # 5
